<!DOCTYPE HTML>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<meta charset="utf-8">
<head th:include="include :: header"></head>
<body class="gray-bg">
    <div class="container-div">
		<div class="col-sm-12 select-info">
			<form id="menu-form">
				<div class="select-list">
					<ul>
						<li class="select-time">
							<label>操作时间： </label>
							<input type="text" class="time-input" id="startTime" placeholder="开始时间" name="beginTime"/>
							<span>-</span>
							<input type="text" class="time-input" id="endTime" placeholder="结束时间" name="endTime"/>
						</li>
						<li style="display: flex;align-items: center;width: 180px;">
							<label style="min-width: 40px;margin-bottom: 0px;">用户：</label>
							<select name="userId" class="form-control" style="width: 100px">
								<option value="">请选择用户&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</option>
								<option th:each="user:${users}" th:value="${user.userId}" th:text="${user.userName + '（' + user.loginName + '）'}"></option>
							</select>
						</li>
						<li>
							部门：<input type="text" name="deptName" placeholder="请输入部门名称"/>
						</li>
						<li>
							<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
							<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
						</li>
					</ul>
				</div>
			</form>
		</div>
		<div class="col-sm-12 select-table table-striped">
			<table id="bootstrap-table" data-mobile-responsive="true"></table>
		</div>
    </div>
    <div th:include="include :: footer"></div>
	<script th:src="@{/ajax/libs/select/select2.js}"></script>
    <script th:inline="javascript">
        var prefix = ctx + "finance/bill/detail"

        $(function() {
            var options = {
                url: prefix + "/detailList",
                modalName: "账户明细",
                search: false,
                columns: [{
                    title: '序号',
                    field: '',
                    formatter: function (value, row, index) {
                        return index+1;
                    }
                },
				{
					field : 'billType',
					title : '类型',
                    align: 'center',
                    formatter: function(value) {
                        return $.table.billTypeLabel(value);
                    }
				},
				{
					field : 'userId', 
					title : '人员编号'
				},
				{
					field : 'userName',
					title : '姓名'
				},
				{
					field : 'deptName',
					title : '部门'
				},
				{
					field : 'price', 
					title : '金额',
                    formatter: function(value, row) {
                        var type = row.billType;
                        return $.table.billMoneyLabel(value, type);
                    }
				},
				{
					field : 'money',
					title : '余额'
				},
				{
					field : 'operator',
					title : '操作人'
				},
				{
					field : 'createTime',
					title : '操作时间'
				},
				{
					field : 'describes',
					title : '冲值说明'
				},
				{
					field : 'remark', 
					title : '备注' 
				}]
            };
            $.table.init(options);
        });
    </script>
</body>
</html>